<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cubrid.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cubrid.examples.html">范例</a></div>
 <div class="up"><a href="book.cubrid.html">CUBRID</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cubrid.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
  <p class="para">
  下列常量在执行SQL语句的时候可能被用到。它们可以被传递给<span class="function"><a href="function.cubrid-prepare.html" class="function">cubrid_prepare()</a></span> 和
  <span class="function"><a href="function.cubrid-execute.html" class="function">cubrid_execute()</a></span>。
  <table class="doctable table">
   <caption><strong>CUBRID SQL 执行标志</strong></caption>
    
     <thead>
      <tr>
       <th>常量</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_INCLUDE_OID</td>
       <td>Determine whether to get OID during query execution.</td>
      </tr>

      <tr>
       <td>CUBRID_ASYNC</td>
       <td>Execute the query in asynchronous mode.</td>
      </tr>

      <tr>
       <td>CUBRID_EXEC_QUERY_ALL</td>
       <td>Execute the query in synchronous mode. This flag must be set
        when executing multiple SQL statements.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
  The following constants can be used when fetching the results to specify
  fetch behaviour. They can be passed to <span class="function"><a href="function.cubrid-fetch.html" class="function">cubrid_fetch()</a></span> and
  <span class="function"><a href="function.cubrid-fetch-array.html" class="function">cubrid_fetch_array()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID fetch flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_NUM</td>
       <td>Get query result as a numeric array (0-default).</td>
      </tr>

      <tr>
       <td>CUBRID_ASSOC</td>
       <td>Get query result as an associative array.</td>
      </tr>

      <tr>
       <td>CUBRID_BOTH</td>
       <td>Get query result as both numeric and associative arrays (default value).</td>
      </tr>

      <tr>
       <td>CUBRID_OBJECT</td>
       <td>Get query result an object.</td>
      </tr>

      <tr>
       <td>CUBRID_LOB</td>
       <td>The constant CUBRID_LOB can be used when you want to operate the
        lob object. It can be passed to <span class="function"><a href="function.cubrid-fetch.html" class="function">cubrid_fetch()</a></span>,
        <span class="function"><a href="function.cubrid-fetch-row.html" class="function">cubrid_fetch_row()</a></span>,
        <span class="function"><a href="function.cubrid-fetch-array.html" class="function">cubrid_fetch_array()</a></span>,
        <span class="function"><a href="function.cubrid-fetch-assoc.html" class="function">cubrid_fetch_assoc()</a></span> and
        <span class="function"><a href="function.cubrid-fetch-object.html" class="function">cubrid_fetch_object()</a></span>.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
   The following constants can be used when positioning the cursor in query
   results. They can be passed to or returned by 
   <span class="function"><a href="function.cubrid-move-cursor.html" class="function">cubrid_move_cursor()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID cursor position flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_CURSOR_FIRST</td>
       <td>Move current cursor to the first position in the result.</td>
      </tr>

      <tr>
       <td>CUBRID_CURSOR_CURRENT</td>
       <td>Move current cursor as a default value if the origin is not specified.</td>
      </tr>

      <tr>
       <td>CUBRID_CURSOR_LAST</td>
       <td>Move current cursor to the last position in the result.</td>
      </tr>

      <tr>
       <td>CUBRID_CURSOR_SUCCESS</td>
       <td>Returned value of <span class="function"><a href="function.cubrid-move-cursor.html" class="function">cubrid_move_cursor()</a></span>
        function in case of success. This flag has been removed from 8.4.1.</td>
      </tr>

      <tr>
       <td>CUBRID_NO_MORE_DATA</td>
       <td>Returned value of <span class="function"><a href="function.cubrid-move-cursor.html" class="function">cubrid_move_cursor()</a></span>
        function in case of failure. This flag has been removed from 8.4.1.</td>
      </tr>

      <tr>
       <td>CUBRID_CURSOR_ERROR</td>
       <td>Returned value of <span class="function"><a href="function.cubrid-move-cursor.html" class="function">cubrid_move_cursor()</a></span>
        function in case of failure. This flag has been removed from 8.4.1.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
   The following constants can be used when setting the auto-commit mode for
   the database connection. They can be passed to
   <span class="function"><a href="function.cubrid-set-autocommit.html" class="function">cubrid_set_autocommit()</a></span> or returned by
   <span class="function"><a href="function.cubrid-get-autocommit.html" class="function">cubrid_get_autocommit()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID auto-commit mode flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_AUTOCOMMIT_TRUE</td>
       <td>Enable the auto-commit mode.</td>
      </tr>

      <tr>
       <td>CUBRID_AUTOCOMMIT_FALSE</td>
       <td>Disable the auto-commit mode.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
   The following constants can be used when setting the database parameter.
   They can be passed to <span class="function"><a href="function.cubrid-set-db-parameter.html" class="function">cubrid_set_db_parameter()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID parameter flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_PARAM_ISOLATION_LEVEL</td>
       <td>Transaction isolation level for the database connection.</td>
      </tr>

      <tr>
       <td>CUBRID_PARAM_LOCK_TIMEOUT</td>
       <td>Transaction timeout in seconds.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
   The following constants can be used when setting the transaction isolation
   level. They can be passed to <span class="function"><a href="function.cubrid-set-db-parameter.html" class="function">cubrid_set_db_parameter()</a></span>
   or returned by <span class="function"><a href="function.cubrid-get-db-parameter.html" class="function">cubrid_get_db_parameter()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID isolation level flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>TRAN_COMMIT_CLASS_UNCOMMIT_INSTANCE</td>
       <td>The lowest isolation level (1). A dirty, non-repeatable or
        phantom read may occur for the tuple and a non-repeatable read may
        occur for the table as well.</td>
      </tr>

      <tr>
       <td>TRAN_COMMIT_CLASS_COMMIT_INSTANCE</td>
       <td>A relatively low isolation level (2). A dirty read does not
        occur, but non-repeatable or phantom read may occur.</td>
      </tr>

      <tr>
       <td>TRAN_REP_CLASS_UNCOMMIT_INSTANCE</td>
       <td>The default isolation of CUBRID (3). A dirty, non-repeatable or
        phantom read may occur for the tuple, but repeatable read is ensured
        for the table.</td>
      </tr>

      <tr>
       <td>TRAN_REP_CLASS_COMMIT_INSTANCE</td>
       <td>A relatively low isolation level (4). A dirty read does not
        occur, but non-repeatable or phantom read may.</td>
      </tr>

      <tr>
       <td>TRAN_REP_CLASS_REP_INSTANCE</td>
       <td>A relatively high isolation level (5). A dirty or non-repeatable
       read does not occur, but a phantom read may.</td>
      </tr>

      <tr>
       <td>TRAN_SERIALIZABLE</td>
       <td>The highest isolation level (6). Problems concerning concurrency
       (e.g. dirty read, non-repeatable read, phantom read, etc.) do not
       occur.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
   The following constants can be used when getting schema information. They
   can be passed to <span class="function"><a href="function.cubrid-schema.html" class="function">cubrid_schema()</a></span>.
  <table class="doctable table">
   <caption><strong>CUBRID schema flags</strong></caption>
    
     <thead>
      <tr>
       <th>Constant</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_SCH_CLASS</td>
       <td>Get name and type of table in CUBRID.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_VCLASS</td>
       <td>Get name and type of view in CUBRID.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_QUERY_SPEC</td>
       <td>Get the query definition of view.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_ATTRIBUTE</td>
       <td>Get the attributes of table column.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_CLASS_ATTRIBUTE</td>
       <td>Get the attributes of table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_METHOD</td>
       <td>Get the instance method. The instance method is a method called
       by a class instance. It is used more often than the class method
       because most operations are executed in the instance.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_CLASS_METHOD</td>
       <td>Get the class method. The class method is a method called by a
        class object. It is usually used to create a new class instance or to
        initialize it. It is also used to access or update class
        attributes.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_METHOD_FILE</td>
       <td>Get the information of the file where the method of the table is
        defined.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_SUPERCLASS</td>
       <td>Get the name and type of table which table inherites attributes
        from.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_SUBCLASS</td>
       <td>Get the name and type of table which inherites attributes from
        this table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_CONSTRAINT</td>
       <td>Get the table constraints.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_TRIGGER</td>
       <td>Get the table triggers.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_CLASS_PRIVILEGE</td>
       <td>Get the privilege information of table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_ATTR_PRIVILEGE</td>
       <td>Get the privilege information of column.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_DIRECT_SUPER_CLASS</td>
       <td>Get the direct super table of table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_PRIMARY_KEY</td>
       <td>Get the table primary key.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_IMPORTED_KEYS</td>
       <td>Get imported keys of table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_EXPORTED_KEYS</td>
       <td>Get exported keys of table.</td>
      </tr>

      <tr>
       <td>CUBRID_SCH_CROSS_REFERENCE</td>
       <td>Get reference relationship of tow tables.</td>
      </tr>

     </tbody>
    
   </table>

  </p>

  <p class="para">
  The following constants can be used when reporting errors. 在报告错误的时候，下列常量可能被用到。它们可能由<span class="function"><a href="function.cubrid-error-code-facility.html" class="function">cubrid_error_code_facility()</a></span>返回。
  <table class="doctable table">
   <caption><strong>CUBRID 错误功能代码</strong></caption>
    
     <thead>
      <tr>
       <th>常量</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>CUBRID_FACILITY_DBMS</td>
       <td>The error occurred in CUBRID dbms.</td>
      </tr>

      <tr>
       <td>CUBRID_FACILITY_CAS</td>
       <td>The error occurred in CUBRID broker cas.</td>
      </tr>

      <tr>
       <td>CUBRID_FACILITY_CCI</td>
       <td>The error occurred in CUBRID cci.</td>
      </tr>

      <tr>
       <td>CUBRID_FACILITY_CLIENT</td>
       <td>The error occurred in CUBRID PHP client.</td>
      </tr>

     </tbody>
    
   </table>

  </p>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cubrid.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cubrid.examples.html">范例</a></div>
 <div class="up"><a href="book.cubrid.html">CUBRID</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
